<template>
  <div>
    <el-dialog title="开票记录" :visible="invoiceDialog" @close="handleClose">
      <el-table :data="invoiceListData" stripe>
        <el-table-column
          type="index"
          label="序号"
          width="50"
          align="left"
        ></el-table-column>

        <el-table-column
          property="invoiceAmount"
          label="开票金额(元)"
          align="left"
        ></el-table-column>
        <el-table-column
          property="invoiceBalance"
          label="剩余开票金额(元)"
          align="left"
        ></el-table-column>
        <el-table-column
          property="createdDate"
          label="开票时间"
          align="left"
        ></el-table-column>
      </el-table>
    </el-dialog>
  </div>
</template>
<script>
import { getInvoiceLis } from "@/api/station/orderHistory";
export default {
  name: "InvoiceRecord",
  props: {
    invoiceDialog: {
      type: Boolean,
      default: false,
    },
    currentRowData: {
      type: Object,
      default: () => {},
    },
  },
  data() {
    return {
      total: 10,
      queryParams: {
        pageNum: 1,
        pageSize: 10,
      },
      invoiceListData: [],
    };
  },
  created() {},
  watch: {
    invoiceDialog(val) {
      if (val) {
        this.getList();
      }
    },
  },
  methods: {
    // 获取列表数据
    getList() {
      console.log("获取列表", this.currentRowData);
      let OrderNo = this.currentRowData.orderNo;
      const businessName = "customer_card_use_record";
      getInvoiceLis({ OrderNo, businessName }).then((res) => {
        this.invoiceListData = res;
        console.log(res);
      });
    },
    handleClose() {
      this.$emit("update:invoiceDialog", false);
    },
  },
};
</script>

<style scoped lang="scss">
::v-deep .el-dialog__body {
  overflow: auto;
}
</style>
